﻿using Dyao.Book.Contract;
using Dyao.Book.Entity;
using Dyao.Book.Repository.Abstractions;

namespace Dyao.Repository.Abstractions
{
    public interface ITaskCenterRecordExtensionRepository : IDataRepository<TaskCenterRecordExtensionEntity, int>
    {
        /// <summary>
        /// 获取任务记录
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="cancellationToken">cancellationToken</param>
        /// <returns></returns>
        Task<TaskCenterRecordInfoDto> GetByIdAsync(int id, CancellationToken cancellationToken = default);

        /// <summary>
        /// 根据属性名获取任务扩展信息
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="propertyNames">属性名</param>
        /// <param name="cancellationToken">任务令牌</param>
        /// <returns></returns>
        Task<TaskCenterRecordInfoDto> GetByPropertyNameAsync(int id, string[] propertyNames, CancellationToken cancellationToken = default);

        /// <summary>
        /// 根据属性名更新属性
        /// </summary>
        /// <param name="extension">任务扩展信息</param>
        /// <param name="propertyNames">属性名</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task UpdateByPropertyNameAsync(TaskCenterRecordExtensionEntity extension, string[] propertyNames, CancellationToken cancellationToken = default);
    }
}
